﻿/********************************************************************************
    Copyright (C) Binod Nepal, Planet Earth Solutions Pvt. Ltd., Kathmandu.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MixNP.BusinessLayer
{
    public static class Users
    {
        public static bool CreateUser(string emailAddress, string name, string nickName, string salt, string password)
        {
            return MixNP.DatabaseLayer.Users.CreateUser(emailAddress, name, nickName, salt, password);
        }

        public static string GetNickNameFromEmailAddress(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetNickNameFromEmailAddress(emailAddress);
        }

        public static string GetNameFromEmailAddress(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetNameFromEmailAddress(emailAddress);
        }

        public static string GetSaltFromEmailAddress(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetSaltFromEmailAddress(emailAddress);
        }

        public static string GetProfilePictureExtension(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetProfilePictureExtension(emailAddress);
        }

        public static string GetEmailAddressFromSalt(string salt)
        {
            return MixNP.DatabaseLayer.Users.GetEmailAddressFromSalt(salt);
        }

        public static bool IsValidToken(string token)
        {
            return MixNP.DatabaseLayer.Users.IsValidToken(token);
        }
        public static bool IsTokenConfirmed(string token)
        {
            return MixNP.DatabaseLayer.Users.IsTokenConfirmed(token);
        }

        public static bool ConfirmRegistration(string token)
        {
            return MixNP.DatabaseLayer.Users.ConfirmRegistration(token);
        }

        public static bool IsValidEmailAddress(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.IsValidEmailAddress(emailAddress);
        }

        public static bool IsEmailConfirmed(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.IsEmailConfirmed(emailAddress);        
        }

        public static bool AuthenticatePassword(string emailAddress, string password, string salt)
        {
            return MixNP.DatabaseLayer.Users.AuthenticatePassword(emailAddress, password, salt);
        }

        public static bool ChangePassword(string emailAddress, string password, string salt)
        {
            return MixNP.DatabaseLayer.Users.ChangePassword(emailAddress, password, salt);
        }

        public static short GetCityId(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetCityId(emailAddress);
        }

        public static string GetCity(string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.GetCity(emailAddress);
        }
        
        public static bool UpdateCity(string emailAddress, int cityId)
        {
            return MixNP.DatabaseLayer.Users.UpdateCity(emailAddress, cityId);
        }

        public static string PasswordResetQueue(string emailAddress, char recoveryMethod, string recoveryAddress, string token)
        {
            return MixNP.DatabaseLayer.Users.PasswordResetQueue(emailAddress, recoveryMethod, recoveryAddress, token);
        }

        public static string GetEmailAddressFromRecoveryCode(string recoveryCode)
        {
            return MixNP.DatabaseLayer.Users.GetEmailAddressFromRecoveryCode(recoveryCode);
        }
        
        public static bool IsValidRecoveryCode(string recoveryCode, string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.IsValidRecoveryCode(recoveryCode, emailAddress);
        }

        public static bool IsValidRecoveryCode(string recoveryCode)
        {
            return MixNP.DatabaseLayer.Users.IsValidRecoveryCode(recoveryCode);
        }

        public static bool FlagRecoveryCode(string recoveryCode, string emailAddress)
        {
            return MixNP.DatabaseLayer.Users.FlagRecoveryCode(recoveryCode, emailAddress);
        }

        public static bool FlagRecoveryCode(string recoveryCode)
        {
            return MixNP.DatabaseLayer.Users.FlagRecoveryCode(recoveryCode);
        }


    }
}
